import MessageActiveIcon from '@/assets/icons/message-active.png'
import MessageInactiveIcon from '@/assets/icons/message-inactive.png'

import ContactsActiveIcon from '@/assets/icons/contacts-active.png'
import ContactsInactiveIcon from '@/assets/icons/contacts-inactive.png'

import SpaceAcive from '@/assets/icons/space-active.png'

import NewsActiveIcon from '@/assets/icons/news-active.png'
import NewsInactiveIcon from '@/assets/icons/news-inactive.png'

import PersonalActiveIcon from '@/assets/icons/personal-active.png'
import PersonalInactiveIcon from '@/assets/icons/personal-inactive.png'

/** @type {import('vue-router').RouteConfig[]} */
export const tabbarRoutes = [
  {
    path: '/message',
    component: () => import('@/views/tabbar/MessageView.vue'),
    meta: {
      name: '消息',
      activeIcon: MessageActiveIcon,
      inactiveIcon: MessageInactiveIcon,
      title: '消息',
      navbarRightMenu: [
        { text: '创建群聊', path: '/create-group' }
      ]
    }
  },
  {
    path: '/contacts',
    component: () => import('@/views/tabbar/ContactsView.vue'),
    meta: {
      name: '通讯录',
      activeIcon: ContactsActiveIcon,
      inactiveIcon: ContactsInactiveIcon,
      title: '通讯录'
    }
  },
  {
    path: '/space',
    component: () => import('@/views/tabbar/SpaceView.vue'),
    meta: {
      name: '',
      activeIcon: SpaceAcive,
      inactiveIcon: SpaceAcive,
      title: '空间',
      navbarRightText: '发布',
      navbarRightPath: '/space-publish'
    }
  },
  {
    path: '/news',
    component: () => import('@/views/tabbar/NewsView.vue'),
    meta: {
      name: '咨讯',
      activeIcon: NewsActiveIcon,
      inactiveIcon: NewsInactiveIcon,
      title: '咨讯'
    }
  },
  {
    path: '/personal',
    component: () => import('@/views/tabbar/PersonalView.vue'),
    meta: {
      name: '我的',
      activeIcon: PersonalActiveIcon,
      inactiveIcon: PersonalInactiveIcon,
      hiddenNavbar: true,
      title: '我的'
    }
  },
]

export const tabbarList = tabbarRoutes.map(route => {
  return {
    path: route.path,
    name: route.meta.name,
    activeIcon: route.meta.activeIcon,
    inactiveIcon: route.meta.inactiveIcon
  }
})

export const tabbarPaths = tabbarRoutes.map(route => {
  return route.path
})
